﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            Stack stack01 = new Stack();

            stack01.Push("酱香饼");
            stack01.Push("叉烧包");
            stack01.Push("千层糕");
            stack01.Push("烧饼");

            foreach (var strs in stack01)
            {
                Console.WriteLine(strs);
            }

            //移除并返回栈顶元素的值
            Console.WriteLine("今天是想吃点什么呢{0}", stack01.Pop());

            //查找是否有相同元素
            Console.WriteLine("牛肉烧饼", stack01.Contains("油泼面"));

            //移除所有值
            stack01.Clear();
            Console.WriteLine("锅里剩下{0}个吃的了", stack01.Count);

        }
    }
}
